<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">

    </div>
</body>
<script src="./node_modules/vue/dist/vue.js"></script>
<script src="./node_modules/vuex/dist/vuex.js"></script>
<script>
    //订单模块
    let orderModule = {
        state:{
            orders:[],
            id:123
        },
        mutations:{

        },
        actions:{

        },
        getters:{

        }
    }
    //购物车模块
    let cartModule={
        state:{
            id:123,
            name:"Thomas"
        },
        mutations:{}, //同步修改
        actions:{}, //异步操作
        getters:{} //计算属性
    }
    let store = new Vuex.Store({
        modules:{
            order:orderModule,
            cart:cartModule
        }
    })
    //访问订单模块
    console.log("订单模块中的:",store.state.order);
    console.log("购物小车模块中的:,",store.state.cart)
</script>
</html>